<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">


    <ui:composition template="../../master.xhtml">

          <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>
        
      
        <ui:define name="TituloModulo">

            Gestão de Utilizadores
        </ui:define>

        <ui:define name="TituloConteudoPrincipal">
           Lista de Grupos
        </ui:define>


        <ui:define name="ConteudoPrincipal">
            <h:form id="formList">
                <p:messages globalOnly="true"/>

                <h:outputText escape="false" value="#{bundle.ListTipoUsuarioEmpty}" rendered="#{tipoUsuarioController.items.rowCount == 0}"/>
                <h:panelGroup id="group" rendered="#{tipoUsuarioController.items.rowCount > 0}">
                    <h:outputText value="#{tipoUsuarioController.pagination.pageFirstItem + 1}..#{tipoUsuarioController.pagination.pageLastItem + 1}/#{tipoUsuarioController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{tipoUsuarioController.previous}" value="#{bundle01.anterior} #{tipoUsuarioController.pagination.pageSize}" rendered="#{tipoUsuarioController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{tipoUsuarioController.next}" value="#{bundle01.posterior} #{tipoUsuarioController.pagination.pageSize}" rendered="#{tipoUsuarioController.pagination.hasNextPage}"/>&nbsp;
                    <p:dataTable id="tabela" value="#{tipoUsuarioController.items}" var="item" >
                        
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle01.designacao}"/>
                            </f:facet>
                            <h:outputText value="#{item.designacao}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle01.descricao}"/>
                            </f:facet>
                            <h:outputText value="#{item.descricao}"/>
                        </p:column>
                        <p:column>
                       
                        <p:menuButton value="Opções">

                                <p:menuitem value="#{bundle01.ver}"  
                                            action="#{tipoUsuarioController.prepareView}" 
                                            icon="ui-icon-extlink" ajax="false"/>

                                <p:menuitem value="#{bundle01.editar}" ajax="false"   
                                            action="#{tipoUsuarioController.prepareEdit}"  
                                            icon="ui-icon-arrowrefresh-1-w" />

                                <p:menuitem value="#{bundle01.eliminar}" icon="ui-icon-trash"  
                                            ajax="false"  action="#{tipoUsuarioController.destroy}"/>
                            </p:menuButton>

                        
                        </p:column>
                        
                        
                        
                    </p:dataTable>
                </h:panelGroup>

                <p:commandButton ajax="false" action="#{tipoUsuarioController.prepareCreate}" value="#{bundle01.criar}"/>
             
            </h:form>
         </ui:define>
    </ui:composition>
</html>
